<?php

declare(strict_types=1);
/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */
namespace app\service\cdc\stat;

use app\enum\CdcEnum;
use app\model\mongo\MongoReportModel;
use app\model\mongo\MongoStatModel;
use app\model\mongo\MongoSyncModel;
use app\service\BaseService;

abstract class StatService extends BaseService
{
    protected ?MongoSyncModel $syncModel;

    protected ?MongoStatModel $statModel;

    protected ?MongoReportModel $recordModel;

    /**
     * @var int 媒体id
     */
    private static int $mediaId = 0;

    public function delLog(array $where = []): bool
    {
        $obj = new $this->statModelList[CdcEnum::STAT_ACCOUNT]();
        return $obj->where($where)->delete() <= 0;
    }

    /**
     * 获取媒体ID.
     */
    public static function getMediaId(): int
    {
        return self::$mediaId;
    }
}
